home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODF-Interest Archive / July 96 / Re Frame Negotiation < prev    next >
Encoding:
Internet Message Format  |  1996-07-18  |  3.3 KB  |  [TEXT/ttxt]

  1. Subject:     Re: Frame Negotiation
  2. Sent:        7/18/96 10:41 AM
  3. Received:    7/18/96 11:01 AM
  4. From:        Henri Lamiraux, lamiraux@apple.com
  5. Reply-To:    ODF Interest, ODF-Interest@CILabs.ORG
  6. To:          OpenDoc Development Framework Discussion List, ODF-Interest@CILabs.
  7.  
  8. >Are there any code examples around which demonstrate a part which 
  9. >requests its frame shape, and a container that can process the requests?  
  10. >The majority of the info on frame negotiation seems to be in the OpenDoc 
  11. >docs and the procedure in ODF seems to be significantly different (ie the 
  12. >proxies get involved, the RequestFrameShape() returns boolean instead of 
  13. >ODShape, etc..)
  14. >
  15. >Some specific questions that I think are related:
  16. >
  17. >What exactly does a part call when it wants to change its shape?  If it 
  18. >should call the frames RequestFrameShape, do I override the method or 
  19. >just call it with the shape I want?
  20. >
  21.  
  22. Look at ODFBitmap (CBitmapFrame::AdjustFrameSize). When a new image is 
  23. dropped on ODFBitmap it request a new frame shape to display as much as 
  24. possible of the new bitmap. When using ODF the default behavior 
  25. implemented by ODF is for a container to grant the new shape (ODFDraw, 
  26. ODFContainer). So in this case you don't have anything to do. Now if you 
  27. need to do something different you need to override 
  28. FW_MProxy::FrameShapeRequested (see ODFTable and ODFEmbed). For example: 
  29. because ODFTable only supports resizing a cell using the mouse it always 
  30. return the cell size in the override of FrameShapeRequested.
  31.  
  32. >What are the Used and Active shapes.  Do you set one of these, and the 
  33. >rest of the frame negotiation is automatic (assuming you accect what you 
  34. >get)?  AdjustActiveShape() and AdjustUsedShape() in FW_CFrame seem to 
  35. >imply that I should do something there, but what?  The ODF docs metion 
  36. >that I probably want to override them, but doesn't say why or what to do 
  37. >in the methods.
  38. >
  39.  
  40. You need to read the OpenDoc Programmer's Guide. It explains what the 
  41. Used and Active shapes are.  ODF implements the default behavior for 
  42. setting the used and active shape. By default, with ODF, the used and 
  43. active shape are set to the frame shape. To change that override 
  44. FW_CFrame::AdjustUsedShape and FW_CFrame::AdjustActiveShape. See the 
  45. ODFClock part for an example.
  46.  
  47. >
  48. >If anyone has the time, desire, sympathy etc to help me out, here's what 
  49. >I'm trying to do:
  50. >I have a container very similar to ODFTable, and the embedded parts need 
  51. >to change their height programatically (ie expand and collapse like 
  52. >folders in the finder).  I want the embedded parts to change their 
  53. >height, and the contining table to change the row height to accomodate 
  54. >the new part height.  Shifting the other embedded frames should be no 
  55. >problem since ODFTable does this when grid lines are dragged anyway.  I 
  56. >need something more than "just call RequestFrameShape()", since I have 
  57. >been unable to uncover any info on how to do this.  If there is sample 
  58. >code which I have missed, pointing me there would help.
  59. >
  60. >Thanks!
  61. >Chris Colapietro
  62.  
  63.  
  64. ........................................................................
  65.  Henri Lamiraux                                      lamiraux@apple.com
  66.  Apple Computer, Inc.                 OpenDoc(tm) Development Framework
  67. ........................................................................
  68.  
  69.  
  70.